package hari3.latihan;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import junit.framework.Assert;

public class CalculatorTestNormal {
		@BeforeClass
		public static void sebelumSemuaTest() {
			System.out.println("sebelumSemuaTest");
		}
		
		@AfterClass
		public static void setelahSemuaTest() {
			System.out.println("setelahSemuaTest");
		}
		
		@Before
		public void sebelumMasingMasingTest() {
			System.out.println("sebelumMasingMasingTest");
		}
		
		@After
		public void setelahMasingMasingTest() {
			System.out.println("setelahMasingMasingTest");
		}
	
	@Test
	public void tambah() {
		Calculator c= new Calculator();
		
		Integer x = 10;
		Integer y = 15;
		
		Integer hasil = c.tambah(x, y);
		Assert.assertEquals(new Integer(25),hasil);
	}
	@Test
	public void kurang() {
		Calculator c= new Calculator();
		
		Integer x = 10;
		Integer y = 15;
		
		Integer hasil = c.kurang(x, y);
		Assert.assertEquals(new Integer(-5),hasil);
	}
	
	@Test
	public void bagi() {
		Calculator c= new Calculator();
		double a = 1000;
		double b = 50;
		
		Double hasil = c.bagi(a,b);
		Assert.assertEquals(new Double(20),hasil);
	}
}
